package com.rybbaby.tss.front.tssAllocation.entity;

import com.rybbaby.tss.front.tssStudent.entity.TssStudent;
import com.rybbaby.tss.platform.sysAdminUser.entity.SysAdminUser;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @description 客户分配表
 * 
 * @author 雷春琼
 * 
 * @createDate 2017-08-15 下午7:26:47
 */
@Entity
@Table(name = "tss_allocation")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TssAllocation implements Serializable {
	
	private static final long serialVersionUID = 382754037960262L;
	
	/** 主键 **/
	private String id;
	/** 客户Id **/
	private String studentId;
	/** 所属顾问id **/
	private String empAdminUserId;
	/** 当前操作者Id **/
	private String adminUserId;
	/** 创建时间 **/
	private Timestamp createTime;
	/** 版本 **/
	private Integer version;
	/** 所属顾问 **/
	private SysAdminUser empAdminUser;
	/** 操作者 **/
	private SysAdminUser amdinUser;
	/** 客户 **/
	private TssStudent tssStudent;
	
	/**
	 * 方法: 取得主键
	 *
	 * @return java.lang.String 主键
	 */
	@Id
	@GeneratedValue(generator = "tss_allocationIDGenerator" , strategy = GenerationType.AUTO)
	@GenericGenerator(name = "tss_allocationIDGenerator" , strategy = "uuid")
	@Column(name = "id", nullable= false, length = 32)
	public String getId() {
		return this.id;
	}
	
	/**
	 * 方法: 设置主键
	 *
	 * @param id 主键
	 */
	public void setId(String id) {
		this.id = id;
	}
	
	/**
	 * 方法: 取得客户Id
	 *
	 * @return java.lang.String 客户Id
	 */
	@Column(name = "studentId", nullable= true, length = 32)
	public String getStudentId() {
		return this.studentId;
	}
	
	/**
	 * 方法: 设置客户Id
	 *
	 * @param studentId 客户Id
	 */
	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}
	
	/**
	 * 方法: 取得员工Id
	 *
	 * @return java.lang.String 员工Id
	 */
	@Column(name = "empAdminUserId", nullable= true, length = 32)
	public String getEmpAdminUserId() {
		return this.empAdminUserId;
	}
	
	/**
	 * 方法: 设置员工Id
	 *
	 * @param empAdminUserId 员工Id
	 */
	public void setEmpAdminUserId(String empAdminUserId) {
		this.empAdminUserId = empAdminUserId;
	}
	
	/**
	 * 方法: 取得当前操作者Id
	 *
	 * @return java.lang.String 当前操作者Id
	 */
	@Column(name = "adminUserId", nullable= true, length = 32)
	public String getAdminUserId() {
		return this.adminUserId;
	}
	
	/**
	 * 方法: 设置当前操作者Id
	 *
	 * @param adminUserId 当前操作者Id
	 */
	public void setAdminUserId(String adminUserId) {
		this.adminUserId = adminUserId;
	}
	
	/**
	 * 方法: 取得创建时间
	 *
	 * @return java.sql.Timestamp 创建时间
	 */
	@Column(name = "createTime", nullable= true, length = 19)
	public java.sql.Timestamp getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * 方法: 设置创建时间
	 *
	 * @param createTime 创建时间
	 */
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
	/**
	 * 方法: 取得版本
	 *
	 * @return java.lang.Integer 版本
	 */
    @Version
	@Column(name = "version", nullable= true, length = 11)
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * 方法: 设置版本
	 *
	 * @param version 版本
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}

	/**
	 *	获取所属顾问
	 * @return
	 */
	@JoinColumn(name = "empAdminUserId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysAdminUser.class)
	public SysAdminUser getEmpAdminUser() {
		return empAdminUser;
	}

	/**
	 *
	 * @param empAdminUser
	 */
	public void setEmpAdminUser(SysAdminUser empAdminUser) {
		this.empAdminUser = empAdminUser;
	}
	/**
	 *	获取操作者
	 * @return
	 */
	@JoinColumn(name = "adminUserId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysAdminUser.class)
	public SysAdminUser getAmdinUser() {
		return amdinUser;
	}
	/**
	 *
	 * @param amdinUser
	 */
	public void setAmdinUser(SysAdminUser amdinUser) {
		this.amdinUser = amdinUser;
	}
	/**
	 *	获取客户详情
	 * @return
	 */
	@JoinColumn(name = "studentId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = TssStudent.class)
	public TssStudent getTssStudent() {
		return tssStudent;
	}
	/**
	 *
	 * @param tssStudent
	 */
	public void setTssStudent(TssStudent tssStudent) {
		this.tssStudent = tssStudent;
	}
}